package com.xs.designpattern;

import lombok.extern.slf4j.Slf4j;

/**
 * @author xs
 */
@Slf4j
public class Main {
    public static void main(String[] args) {
        log.info("骑士收到一把附魔剑..");
        Sword enchantedSword = new Sword(new SoulEatingEnchantment());
        enchantedSword.wield();
        enchantedSword.swing();
        enchantedSword.unwield();
        //改变附魔属性
        Sword enchantedSword1 = new Sword(new FlyingEnchantment());
        enchantedSword1.wield();
        enchantedSword1.swing();
        enchantedSword1.unwield();

        log.info("女武神收到一把附魔锤..");
        Hammer hammer = new Hammer(new FlyingEnchantment());
        hammer.wield();
        hammer.swing();
        hammer.unwield();
        //改变附魔属性
        Hammer hammer1 = new Hammer(new SoulEatingEnchantment());
        hammer1.wield();
        hammer1.swing();
        hammer1.unwield();
    }
}